package com.wang.nio;

import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;

import com.google.common.io.Resources;

public class TestGuava {

	
	public static String getHtml(String url) {
	    if (url==null) {
	        return null;
	    }
	    try {
	        return Resources.toString(new URL(url), StandardCharsets.UTF_8);
	    } catch (IOException e) {
	        throw new RuntimeException(e);
	    }
	}
}
